| Conditions | 1 |
| Paths | 1 |
| Total Lines | 52 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | var gulp = require('gulp'); |
||
| 4 | gulp.task('default', function() { |
||
| 5 | |||
| 6 | // procesar SCSS |
||
| 7 | gulp.src(['node_modules/select2/dist/css/select2.css', 'web/css/**/*.scss', 'web/css/source-sans-pro/css/fonts.css', 'node_modules/font-awesome-animation/dist/font-awesome-animation.css', 'node_modules/patternfly-bootstrap-treeview/dist/bootstrap-treeview.css', 'web/css/atica.css']) |
||
| 8 | .pipe(plugins.sass()) |
||
| 9 | .pipe(plugins.autoprefixer({ |
||
| 10 | browsers: [ |
||
| 11 | 'Android 2.3', |
||
| 12 | 'Android >= 4', |
||
| 13 | 'Chrome >= 20', |
||
| 14 | 'Firefox >= 3.6', |
||
| 15 | 'Explorer >= 8', |
||
| 16 | 'iOS >= 6', |
||
| 17 | 'Opera >= 12', |
||
| 18 | 'Safari >= 6' |
||
| 19 | ], |
||
| 20 | cascade: false |
||
| 21 | })) |
||
| 22 | .pipe(plugins.concat('pack.css')) |
||
| 23 | .pipe(plugins.cleanCss({ |
||
| 24 | compability: 'ie8' |
||
| 25 | })) |
||
| 26 | .pipe(gulp.dest('web/dist/css')); |
||
| 27 | |||
| 28 | // copiar jQuery |
||
| 29 | gulp.src('node_modules/jquery/dist/*.min.js') |
||
| 30 | .pipe(gulp.dest('web/dist/js/jquery')); |
||
| 31 | |||
| 32 | // copiar Javascript de Bootstrap |
||
| 33 | gulp.src('node_modules/bootstrap-sass/assets/javascripts/*.min.js') |
||
| 34 | .pipe(gulp.dest('web/dist/js/bootstrap')); |
||
| 35 | |||
| 36 | // copiar Javascript de Select2 |
||
| 37 | gulp.src('node_modules/select2/dist/js/select2.min.js') |
||
| 38 | .pipe(gulp.dest('web/dist/js/select2')); |
||
| 39 | gulp.src('node_modules/select2/dist/js/i18n/*') |
||
| 40 | .pipe(gulp.dest('web/dist/js/select2/i18n')); |
||
| 41 | |||
| 42 | // copiar Javascript de patternfly-bootstrap-treeview |
||
| 43 | gulp.src('node_modules/patternfly-bootstrap-treeview/dist/*.min.js') |
||
| 44 | .pipe(gulp.dest('web/dist/js/bootstrap-treeview')); |
||
| 45 | |||
| 46 | // copiar Javascript y CSS de Dropzone.js |
||
| 47 | gulp.src('node_modules/dropzone/dist/dropzone.js') |
||
| 48 | .pipe(gulp.dest('web/dist/js/dropzone')); |
||
| 49 | gulp.src('node_modules/dropzone/dist/min/dropzone.min.css') |
||
| 50 | .pipe(gulp.dest('web/dist/css')); |
||
| 51 | |||
| 52 | // copiar fuentes |
||
| 53 | gulp.src(['node_modules/font-awesome/fonts/*', 'web/css/source-sans-pro/fonts/**']) |
||
| 54 | .pipe(gulp.dest('web/dist/fonts')); |
||
| 55 | }); |
||
| 56 |